home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir24
/
jnos110g.zip
/
FNTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-17
|
818b
|
40 lines
/* A simple File name test program.
* Prints all 255 ascii values, and shows filename validity .
*/
#include <stdio.h>
/* Valid characters in a DOS filename matrix */
static unsigned char doschars[] = {
0x00, 0x00, 0x00, 0x00, 0xfa, 0x23, 0xff, 0x03,
0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0x6f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
int dosfnchr(int);
int
dosfnchr(ch)
int ch;
{
int i, j;
i = (ch & 0xf8) >> 3;
j = doschars[i] & (1 << (ch & 0x07));
return j;
}
void main(void);
void main(void) {
int i,cols;
for(i=0;i<256;i++) {
printf("%3d: %s ",i,dosfnchr(i) ? "good" : "BAD!");
if(i%6 == 0)
printf("\n");
}
}